Fix xenopsd
common.py
's VIF.get_ethtool()
passing two args to list().append()
#5922
+138
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow-up of #5921 that includes #5921 (please merge first) as it depends on it:
xenopsd
: Fixpytype
warning onget_words
: Namestring
is not defined #5921 and two commits (onget_ethtool()
) are for this PR.For @stephenchengCloud:
FYI: @ashwin9390
In #5896 (review), changes were requested:
Before merging
feature/py3
intomaster
, certain warnings in files that weren't checked so far should be fixed.This PR fixes two of the mentioned
pytype
warnings:These are from these lines:
These
ethtool settings
are documented in the document Develop for XenServer starting at page 75.As can be seen on the blame view, these two arguments have been there for 12 years. Maybe they worked in Python versions before Python2.7, but they did not even work in Python2.7.
Reaching such
append(a, b)
would raise aTypeError
with any Interpreter that I can find:This PR adds a test to cover the method containing them and then fixes the bug.
The only call site of
VIF().get_ethtool()
is at https://github.com/xapi-project/xen-api/blob/feature/py3/ocaml/xenopsd/scripts/common.py#L229.It expects that
get_ethtool()
returns a list of key/value sets like so: [(k, True), (k, False)], so pass (and return)k, bool
as aset
:.append((k, bool))
.